package cn.gson.springmvc.model.pojos;

import javax.persistence.*;
import java.util.Collection;
import java.util.Objects;

@Entity
public class Diagdetails {
    private int diagdetailsId;
    private Integer diagdetailsNumber;
    private String diagdetailsUsage;
    private Electpres electpresByElectpresId;

    @Id
    @Column(name = "diagdetails_id", nullable = false)
    public int getDiagdetailsId() {
        return diagdetailsId;
    }

    public void setDiagdetailsId(int diagdetailsId) {
        this.diagdetailsId = diagdetailsId;
    }

    @Basic
    @Column(name = "diagdetails_number", nullable = true)
    public Integer getDiagdetailsNumber() {
        return diagdetailsNumber;
    }

    public void setDiagdetailsNumber(Integer diagdetailsNumber) {
        this.diagdetailsNumber = diagdetailsNumber;
    }

    @Basic
    @Column(name = "diagdetails_usage", nullable = true, length = 50)
    public String getDiagdetailsUsage() {
        return diagdetailsUsage;
    }

    public void setDiagdetailsUsage(String diagdetailsUsage) {
        this.diagdetailsUsage = diagdetailsUsage;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Diagdetails that = (Diagdetails) o;
        return diagdetailsId == that.diagdetailsId &&
                Objects.equals(diagdetailsNumber, that.diagdetailsNumber) &&
                Objects.equals(diagdetailsUsage, that.diagdetailsUsage);
    }

    @Override
    public int hashCode() {
        return Objects.hash(diagdetailsId, diagdetailsNumber, diagdetailsUsage);
    }

    @ManyToOne
    @JoinColumn(name = "electpres_id", referencedColumnName = "electpres_id")
    public Electpres getElectpresByElectpresId() {
        return electpresByElectpresId;
    }

    public void setElectpresByElectpresId(Electpres electpresByElectpresId) {
        this.electpresByElectpresId = electpresByElectpresId;
    }


}
